<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVOwnersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('v_owners', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger('member_id')->default(0)->comment('用户ID');
            $table->uuid('uuid')->comment('唯一标识');
            $table->string('card_no',32)->default('')->comment('身份证号');
            $table->string('pic_card_front',1024)->default('')->comment('身份证正面照片');
            $table->string('pic_card_back',1024)->default('')->comment('身份证反面照片');
            $table->string('pic_card_face',1024)->default('')->comment('手持身份证照片');
            $table->string('company_name',128)->default('')->comment('企业名称');
            $table->string('pic_company_certificate',1024)->default('')->comment('企业营业执照图片');
            $table->tinyInteger('status')->default(0)->comment('状态,10实名认证，20企业认证');
            $table->timestamps();
            $table->index('member_id', 'idx_memeber_id');
            $table->index('uuid', 'idx_uuid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('v_owners');
    }
}
